.TH "rtcSetSceneProgressMonitorFunction" "3" "" "" "Embree Ray Tracing Kernels 3"
.SS NAME
.IP
.nf
\f[C]
rtcSetSceneProgressMonitorFunction\ \-\ registers\ a\ callback
\ \ to\ track\ build\ progress
\f[]
.fi
.SS SYNOPSIS
.IP
.nf
\f[C]
#include\ <embree3/rtcore.h>

typedef\ bool\ (*RTCProgressMonitorFunction)(
\ \ void*\ ptr,
\ \ double\ n
);

void\ rtcSetSceneProgressMonitorFunction(
\ \ RTCScene\ scene,
\ \ RTCProgressMonitorFunction\ progress,
\ \ void*\ userPtr
);
\f[]
.fi
.SS DESCRIPTION
.PP
Embree supports a progress monitor callback mechanism that can be used
to report progress of hierarchy build operations and to cancel build
operations.
.PP
The \f[C]rtcSetSceneProgressMonitorFunction\f[] registers a progress
monitor callback function (\f[C]progress\f[] argument) with payload
(\f[C]userPtr\f[] argument) for the specified scene (\f[C]scene\f[]
argument).
.PP
Only a single callback function can be registered per scene, and further
invocations overwrite the previously set callback function.
Passing \f[C]NULL\f[] as function pointer disables the registered
callback function.
.PP
Once registered, Embree will invoke the callback function multiple times
during hierarchy build operations of the scene, by passing the payload
as set at registration time (\f[C]userPtr\f[] argument), and a double in
the range [0, 1] which estimates the progress of the operation
(\f[C]n\f[] argument).
The callback function might be called from multiple threads
concurrently.
.PP
When returning \f[C]true\f[] from the callback function, Embree will
continue the build operation normally.
When returning \f[C]false\f[], Embree will cancel the build operation
with the \f[C]RTC_ERROR_CANCELLED\f[] error code.
Issuing multiple cancel requests for the same build operation is
allowed.
.SS EXIT STATUS
.PP
On failure an error code is set that can be queried using
\f[C]rtcDeviceGetError\f[].
.SS SEE ALSO
.PP
[rtcNewScene]
